export default class WindowSet {
  /*
   ** 设置页面标题
   *  参数：title: 标题
   */
  static setTitle({title = ''} = {}) {
    document.title = title
    let mobile = navigator.userAgent.toLowerCase()
    if (/iphone|ipad|ipod/.test(mobile)) {
      let iframe = document.createElement('iframe')
      iframe.style.visibility = 'hidden'
      iframe.style.height = 0
      iframe.style.width = 0
      // 替换成站标favicon路径或者任意存在的较小的图即可
      iframe.setAttribute('src', 'https://www.yuelinghui.com/favico.png')
      let iframeCallback = function () {
        setTimeout(function () {
          iframe.removeEventListener('load', iframeCallback)
          document.body.removeChild(iframe)
        }, 10)
      }
      iframe.addEventListener('load', iframeCallback)
      document.body.appendChild(iframe)
    }
  }
}